package com.itcoon.cloud.framework.webmvc.request;


import com.itcoon.cloud.framework.page.ISortPage;
import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Schema
public class SortPage implements ISortPage {

    /**
     * 每页记录数(0和空值表示不分页)
     */
    @Min(0L)
    @NotNull
    @Schema(
            description = "每页记录数(0和空值表示不分页)",
            example = "0"
    )
    private Integer current = 0;

    /**
     * 每页记录数(0和空值代表查询所有), pageNo = 0时, 表示查询结果数
     */
    @Min(0L)
    @NotNull
    @Schema(
            description = "每页记录数(0和空值代表查询所有), pageNo = 0时, 表示查询结果数",
            example = "0"
    )
    private Integer size = 0;

    @Schema(description = "正序排序数据库表字段名列表", example = "")
    private String[] ascProperties = new String[0];

    @Schema(description = "倒序排序数据库表字段名列表", example = "update_time")
    private String[] descProperties = new String[0];

    @Override
    public Integer getCurrent() {
        return current;
    }

    public void setCurrent(Integer current) {
        this.current = current;
    }

    @Override
    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    @Override
    public String[] getAscProperties() {
        return ascProperties;
    }

    public void setAscProperties(String[] ascProperties) {
        this.ascProperties = ascProperties;
    }

    @Override
    public String[] getDescProperties() {
        return descProperties;
    }

    public void setDescProperties(String[] descProperties) {
        this.descProperties = descProperties;
    }
}
